<%-- 
    Document   : order_history
    Created on : 21.04.2013, 15:21:26
    Author     : Yasya,Svetlana Shikhutskaya
--%>

<%@page import="delta.cart.bean.CartLocal"%>
<%@page import="entity.Users"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    CartLocal cart = (CartLocal) session.getAttribute("cart");
    Users user = (Users) session.getAttribute("user");
    Integer pageNumber = (Integer) session.getAttribute("pageNumber");
    String sortBy = (String) session.getAttribute("sortBy");
    if (sortBy == null) {
        sortBy = "Date";
    }
    if (pageNumber == null || pageNumber == 0) {
        pageNumber = 1;
    }
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/order_history.css">
           <link rel="stylesheet" type="text/css" href="css/all.css">
        <script type="text/javascript" src="scripts/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="scripts/order-history.js"></script>
        <title>our_product</title>
    </head>
    <body onload="init()">
        <header>
            <input type="hidden" id="sort-by" value="<%=sortBy%>"/>
            <input type="hidden" id="page-number" value="<%=pageNumber%>"/>
            <input type="hidden" id="id-user" value="<%=user.getIdUser()%>"/>
            <div id ="top_name">  <a href="main.jsp"> <img src="/Delta-war/product/1.jpeg"></a> <h1> Product</h1> </div>
            <h1><%=user.getLogin()%></h1> </div>
           <div id="registr2">
                <a href="logout">Logout</a> 
            </div>
            <div id ="shopping">    
                <a href="cart_user.jsp">Cart</a>                     
                <input type="text" name="Count_product" size="1" readonly value="<%=cart.getCount()%>" /> products
            </div>
            <div id="price_shopping"> <input type="text" name="Prcie" size="8" readonly value="<%=cart.getTotalPrice()%>" /> $  
            </div>

            
        </header>
        <div id="main">
            <div id="menu">
                <ul>
                    <li><a href="user_name.jsp">Profile<%session.setAttribute("pageNumber", null);%></a></li>
                    <li><a href="order_history.jsp">Order history</a></li>
                </ul>
            </div>

            <div id="sorted" style="margin-top: 60px">
                Sort by:  &nbsp   <select name="sort" id="sorts" class="sort-order" size = 1> 
                    <option value='Date' <% if (sortBy.equals("Date")) {%>selected<%}%>>Date</option>
                    <option value='Sum' <% if (sortBy.equals("Sum")) {%>selected<%}%>>Sum</option>
                    <option value='Number'<% if (sortBy.equals("Number")) {%>selected<%}%>>Number</option>
                </select> 
            </div>

            <div id="tabl1">
                <table class="table-orders">
                    <TR>
                        <td id="head"><strong>Order number</strong></td>
                        <td id="head"><strong>Date</strong></td>
                        <td id="head"><strong>Delivery date</strong></td>
                       
                        <td id="head"><strong>Sum</strong></td>
                        <td id="head"><strong>Status</strong></td>
                        <td id="head"><strong>Address</strong></td>
                    </TR>
                </table>

            </div>
            <div style="margin-left: 17%;  ">
                <div id="line_button">
                    <form class="left-page" method="Post">
                        <button type="submit"><<</button>
                        <span style="font-size: 14px" id="num"></span>
                        <span style="font-size: 14px"> of </span>
                        <span style="font-size: 14px" id="total-num"></span>
                        <span style="font-size: 14px"> pages</span>
                    </form>
                </div>
                <div id="line_button">
                    <form class="right-page" method="Post">
                        <button type="submit">>></button>
                    </form>
                </div>
                <div class="line_button">
                    <input id="jump-page"  oninput="validateJumpPage()" type="text"/>
                </div>
                <div class="line_button">
                    <form class="js-jump-page" method="Post">
                        <button id="jump-btn" style="position: relative; left: 3%; background:  #b8b0fd; " type="submit" disabled="true">Jump</button>
                    </form>
                </div>
                <div class="line_button">
                    <span style="font-size: 14px; color: red" id="jump-warning"></span>
                </div>
            </div>
        </div>
                 <div id="footer">
                                <p>  &#169;All rights reserved</p>
                            </div>
    </body>
</html>
